<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../../css/iuapmobile.um.css">
		<link rel="stylesheet" href="../../css/font-icons.css">
		<link rel="stylesheet" href="../../css/iscroll.css" />
		<script src="../../js/summer.js"></script>
		<script src="../../js/jquery.min.js"></script>
		<script src="../../js/Frameworks/iuapmobile.frameworks.ui.js"></script>
		<script src="../../js/iscroll.js"></script>
		<script src="../../js/angular.min.js"></script>
		<script src="../../js/mobiscroll_002.js" type="text/javascript"></script>
		<script src="../../js/mobiscroll_004.js" type="text/javascript"></script>
		<link href="../../css/mobiscroll.css" rel="stylesheet" type="text/css">
		<script src="../../js/mobiscroll.js" type="text/javascript"></script>
		<script src="../../js/mobiscroll_003.js" type="text/javascript"></script>
		<script src="../../js/mobiscroll_005.js" type="text/javascript"></script>
		<link href="../../css/mobiscroll_003.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.3&key=bf5e7c7172c343df4547ecc206a8cfca"></script>
		<script type="text/javascript" src="http://developer.baidu.com/map/jsdemo/demo/convertor.js"></script>
		<script type="text/javascript">
			var getgaode = function(a) {
			};
			AMap.plugin('AMap.Geocoder', function() {
				var geocoder = new AMap.Geocoder({
					city : "010" //城市，默认：“全国”
				});
				getgaode = function(a) {
					geocoder.getAddress(a, function(status, result) {
						if (status == 'complete') {
							console.log(result);
						}
					});
				}
			});
		</script>
		<style>
			.um-list .um-list-item-left {
				width: 45%;
			}
			.select {
				border: 0px solid #fff;
				position: relative;
				display: inline-block;
				width: 150px;
				height: 25px;
				background-color: #fff;
				font: 14px/20px "Microsoft YaHei";
				color: #000;
				direction: rtl;
				appearance: none;
				-moz-appearance: none;
				-webkit-appearance: none;
			}
			.cart-reduce, .cart-add {
				display: inline-block;
				font-size: 16px;
				color: RGB(157, 194, 59);
				white-space: nowrap;
				text-align: center;
				cursor: pointer;
				border-radius: 50%;
				width: 22px;
				height: 22px;
				border: 1px solid RGB(157, 194, 59);
				padding: 0;
				z-index: 10;
				line-height: 18px;
			}
			.cart-count {
				max-width: 30px;
				border: none;
				border-bottom: 1px solid RGB(157, 194, 59);
				text-align: center;
				-moz-appearance: textfield;
			}
		</style>
	</head>
	<body class="f14" ng-app="myApp" ng-controller="myCtrl" ng-init="shfwzt=true">
		<div class="um-page" id="index">
			<div class="um-header">
				<a href="#" class="um-back" ng-click="close()"> 返回 </a>
				<h3>勘察单详情</h3>
				<a href="#" class="um-header-right">
				<p>
					<span class="menu">暂存</span>
				</p> </a>
			</div>

			<div class="um-content">
				<form id="">
					<ul class="um-list">
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>点位编号
									</div>
									<div class="um-list-item-right">
										<input type="text" ng-model="formdata.dwbh1" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>企业经营名称
									</div>
									<div class="um-list-item-right">
										<input type="text" ng-model="formdata.sjjymc1" class="form-control tr"  disabled="true"  required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>企业经营地址
									</div>
									<div class="um-list-item-right">
										<input type="text" ng-model="formdata.sjjydz1" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>店面负责人
									</div>
									<div class="um-list-item-right">
										<input type="text" ng-model="formdata.dmfzr1" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>联系电话
									</div>
									<div class="um-list-item-right">
										<input type="text" ng-model="formdata.lxfs1" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>施工单位名称
									</div>
									<div class="um-list-item-right">
										<input type="text" ng-model="formdata.sgdw1" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>商家所在位置经度
									</div>
									<div class="um-list-item-right">
										<input type="text" id="jd1" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>商家所在位置纬度
									</div>
									<div class="um-list-item-right">
										<input type="text" id="wd1" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>设备类型
									</div>
									<div class="um-list-item-right">
										<input type="text" ng-model="formdata.sblx1" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>安装方式
									</div>
									<div class="um-list-item-right">
										<input type="text" ng-model="formdata.azfs1"  class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>尺寸
									</div>
									<div class="um-list-item-right">
										<input type="text" ng-model="formdata.materialspec" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						</ul>
						
                        <div class="btn" style="background: #9dc23b;border-radius: 0 ;color: #ffffff;font-size: 12px;padding:2px 2px">
                            		以上信息不可修改
                        </div>

						<ul class="um-list">
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>设备安装位置（远景）
									</div>
									<div class="um-list-item-right">
										<img id="sbazwzyj1" onclick="openCamera(this,pageid)" ng-src="{{formdata.sbazwzyj1}}" class="h50 p5 camera" />
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-white">*</span>设备安装位置（近景）
									</div>
									<div class="um-list-item-right">
										<img id="sbazwzjj1" onclick="openCamera(this,pageid)" ng-src="{{formdata.sbazwzjj1}}" class="h50 p5 camera" />
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>设备取电位置
									</div>
									<div class="um-list-item-right">
										<select ng-model="formdata.sbqdwz1" id='selectsbqdwz1' class="select" >
											<option  value="0" >请选择</option>
											<option ng-repeat="x in selectlist.sbqdwz1list" value="{{x.pk_doc}}">{{x.doc_name}}</option>
										</select>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>摄像机安装位置{{formdata.sxjazwz1.length}}
									</div>
									<div class="um-list-item-right">
										<span class="cart-reduce " ng-click="reducepic()">+</span>
										<input type="number" id="bcameranum" ng-model="bcameranum" class="cart-count" placeholder="请填写" required style="padding-right: 0px;">
										<span class="cart-add " ng-click="addpic()">-</span>
									</div>
								</div>
							</div>
						</li>
						<li >
							<div ng-repeat="item in sxjazwz1" class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>摄像机安装位置{{item.index}}
									</div>
									<div class="um-list-item-right">
										<img id="sxjazwz1_{{item.index}}" onclick="openCamera(this,pageid)" ng-src="{{item.src}}" class="h50 p5 camera" />
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>摄像机取电位置
									</div>
									<div class="um-list-item-right">
										<select ng-model="formdata.sxjqdwz1" id='sxjqdwz1' class="select" >
											<option  value="0" >请选择</option>
											<option ng-repeat="x in selectlist.sxjqdwz1list" value="{{x.pk_doc}}">{{x.doc_name}}</option>
										</select>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>外网接入位置
									</div>
									<div class="um-list-item-right">
										<select ng-model="formdata.wwjrwz1" id='wwjrwz1' class="select" >
											<option  value="0" >请选择</option>
											<option ng-repeat="x in selectlist.wwjrwz1list" value="{{x.pk_doc}}">{{x.doc_name}}</option>
										</select>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>安装开始时间
									</div>
									<div class="um-list-item-right">
										<!--<input type="text"  class="demo-input" style="text-align: right;border:0px solid #fff" placeholder="请选择日期" id="azks1" readonly="true"/>-->
									    <input runat="server" name="date" id="azks1" placeholder="请选择日期"  class="form-control" style="text-align: right" readonly="true" >
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>安装结束时间
									</div>
									<div class="um-list-item-right">
										<!--<input type="text" class="demo-input" style="text-align: right;border:0px solid #fff" placeholder="请选择日期" id="azjs1" readonly="true"/>-->
									  
                                     <input runat="server" name="date"  id="azjs1" placeholder="请选择日期"  class="form-control" style="text-align: right">

									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>安装时长
									</div>
									<div class="um-list-item-right" >
										<input type="text"  id="azsc1" class="form-control tr"  disabled="true" required>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>施工人员已根据商家装修结构给商家详细描述线路敷设路程
									</div>
									<div class="um-list-item-right">
										<label class="um-switch2 um-box-vc ">
											<input type="checkbox" class="um-switch2" id="def1" ng-model="formdata.def1" ng-checked="def1" />
											<span class="um-switch2-check" data-on-text="是" data-off-text="否"  style="margin-right: 0px; "></span> </label>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>商家是否同意按照施工人员描述内容进行安装
									</div>
									<div class="um-list-item-right">
										<label class="um-switch2 um-box-vc ">
											<input type="checkbox" class="um-switch2" id="def79" ng-model="formdata.def79" ng-checked="def79" />
											<span class="um-switch2-check" data-on-text="是" data-off-text="否"  style="margin-right: 0px; "></span> </label>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>商家已经知晓并签署了《智慧食安信息化系统使用协议》
									</div>
									<div class="um-list-item-right">
										<label class="um-switch2 um-box-vc ">
											<input type="checkbox" class="um-switch2" id="def2" ng-model="formdata.def2" ng-checked="def2" />
											<span class="um-switch2-check" data-on-text="是" data-off-text="否"  style="margin-right: 0px; "></span> </label>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>商家是否与商场或物业方沟通办理施工手续
									</div>
									<div class="um-list-item-right">
										<label class="um-switch2 um-box-vc ">
											<input type="checkbox" class="um-switch2" id="def3" ng-model="formdata.def3" ng-checked="def3" />
											<span class="um-switch2-check" data-on-text="是" data-off-text="否"  style="margin-right: 0px; "></span> </label>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>商家是否同意按照施工人员描述内容进行安装
									</div>
									<div class="um-list-item-right">
										<label class="um-switch2 um-box-vc ">
											<input type="checkbox" class="um-switch2" id="def72" ng-model="formdata.def72" ng-checked="def72" />
											<span class="um-switch2-check" data-on-text="是" data-off-text="否"  style="margin-right: 0px; "></span> </label>
									</div>
								</div>
							</div>
						</li>
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-white">*</span>商家其他意见
									</div>
									<div class="um-list-item-right">
										<textarea ng-model="formdata.qtyj1" name="" id="" cols="30" rows="10" class="form-control"></textarea>
									</div>
								</div>
							</div>
						</li>
						
						<!--<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>安装派工单中对应店面负责人签字确认
									</div>
									<div class="um-list-item-right">
									  <a id="changepage2" href="#page2" style="display: none"></a>
										<img id="qzqr1" ng-click="opendraw()" ng-src="{{formdata.qzqr1}}" class="h50 p5" />
									</div>
								</div>
								<div class="um-list-item-inner">
									<div class="um-list-item-left pl5">
										<span class="um-red">*</span>安装派工单中对应店面负责人签字确认
									</div>
									<div class="um-list-item-right">
										<img id="qz" onclick="openCamera(this,pageid)" ng-src="{{formdata.qz}}" class="h50 p5 camera" />
									</div>
								</div>
							</div>
						</li>-->
						<li>
							<div class="um-list-item">
								<div class="um-list-item-inner">
								
                                <button class="btns btn-sm" ng-click="submit()">提交</button>

								</div>
							</div>
						</li>	
					</ul>
					
				</form>
			</div>
          
			
		</div>
		<!--s<div class="um-page" id="page2">
		<div class="um-header">
				<a href="#" id="back" class="um-back" style="display: none"> </a>
				<a href="#" ng-click="cancelpic()" class="um-back"> 取消 </a>
				<h3>点位信息录入</h3>
				<a href="#" ng-click="savepic()" class="um-header-right">
					<p>
						<span class="menu">确定</span>
					</p>
				</a>
			</div>
						<div class="um-content" >
							<canvas id="canvas"></canvas>
						</div>
					</div>-->
	</body>
</html>
<script>
	
	var bodyid;
	var angularScope;
	var LOCAT_CAMERA="../../img/myimg/camera.png";
	
	
	function bindsbqdwz1list() {
		doPost(adressHead.ISjtzImpl, "getBdDoc", {
			dataParm: {
				dostype: "app033"
			}
		}, function(jsons) {
			angularScope.selectlist.sbqdwz1list = jsons;
			angularScope.$apply();
		}, null, true);
	}
	function bindsxjqdwz1list() {
		doPost(adressHead.ISjtzImpl, "getBdDoc", {
			dataParm: {
				dostype: "app034"
			}
		}, function(jsons) {
			angularScope.selectlist.sxjqdwz1list = jsons;
			angularScope.$apply();
		}, null, true);
	}
	function bindwwjrwz1list() {
		doPost(adressHead.ISjtzImpl, "getBdDoc", {
			dataParm: {
				dostype: "app035"
			}
		}, function(jsons) {
			angularScope.selectlist.wwjrwz1list = jsons;
			angularScope.$apply();
		}, null, true);
	}
	summerready = function() {
			bindsbqdwz1list();
			bindsxjqdwz1list();
			bindwwjrwz1list();
				if (summer.pageParam) {
					bodyid = summer.pageParam.bodyid;
					billcode = summer.pageParam.billcode;
					pageparam = summer.pageParam;
					//imglist = summer.pageParam.sxjsl1; //获取到的摄像机数量
				}
				doPost(adressHead.IAzpgDwkcImpl2, "getAzpgDwKcxxxx", {
					dataParm : {
						bodyid : bodyid
					}
				}, function(data) {
				    
					var jsonobj = data.data;
					angularScope.formdata.bodyid = jsonobj.bodyid == null ? "":jsonobj.bodyid;
					angularScope.formdata.dwbh1 = jsonobj.dwbh1 == null ? "":jsonobj.dwbh1;
					angularScope.formdata.sjjymc1 = jsonobj.sjjymc1 == null ? "":jsonobj.sjjymc1;
					angularScope.formdata.sjjydz1 = jsonobj.sjjydz1 == null ? "":jsonobj.sjjydz1;
					angularScope.formdata.dmfzr1 = jsonobj.dmfzr1 == null ? "":jsonobj.dmfzr1;
					angularScope.formdata.lxfs1 = jsonobj.lxfs1 == null ? "":jsonobj.lxfs1;
					angularScope.formdata.sblx1 = jsonobj.sblx1 == null ? "":jsonobj.sblx1;
					angularScope.formdata.azfs1 = jsonobj.azfs1 == null ? "":jsonobj.azfs1;
					angularScope.formdata.materialspec = jsonobj.materialspec == null ? "":jsonobj.materialspec;
					angularScope.formdata.sgdw1 = jsonobj.sgdw1 == null ? "":jsonobj.sgdw1;
					angularScope.formdata.sbazwzyj1 = jsonobj.bdef90 == null ? LOCAT_CAMERA:getImgUrl(jsonobj.bdef90);
					angularScope.formdata.sbazwzjj1 = jsonobj.bdef89 == null ? LOCAT_CAMERA:getImgUrl(jsonobj.bdef89);
					angularScope.formdata.sbqdwz1 = jsonobj.bdef88 == null ? "":jsonobj.bdef88;
					angularScope.formdata.sxjqdwz1 = jsonobj.bdef87 == null ? "":jsonobj.bdef87;
					angularScope.formdata.wwjrwz1 = jsonobj.bdef86 == null ? "":jsonobj.bdef86;
			
					angularScope.formdata.def1 = jsonobj.bdef83 == null ? false:jsonobj.bdef83;
					angularScope.formdata.def2 = jsonobj.bdef82 == null ? false:jsonobj.bdef82;
					angularScope.formdata.def3 = jsonobj.bdef81 == null ? false:jsonobj.bdef81;
					angularScope.formdata.qtyj1 = jsonobj.bdef80 == null ? "":jsonobj.bdef80;
					angularScope.formdata.def79 = jsonobj.bdef79 == null ? false:jsonobj.bdef79;
					angularScope.formdata.def72 = jsonobj.bdef72 == null ? false:jsonobj.bdef72;
					
					//angularScope.sbazwzyj1 = jsonobj.bdef76 == null ? "":jsonobj.bdef76;
					//angularScope.sbazwzyj1 = jsonobj.bdef75 == null ? "":jsonobj.bdef75;
					//angularScope.sbazwzyj1 = jsonobj.bdef74 == null ? "":jsonobj.bdef74;
					//angularScope.sbazwzyj1 = jsonobj.bdef73 == null ? "":jsonobj.bdef73;
					if(jsonobj.bdef76){
						var data = {
						"index" : 1,
						"src" : getImgUrl(jsonobj.bdef76)
					    };
					    angularScope.sxjazwz1.push(data);
					    angularScope.bcameranum = angularScope.bcameranum+1;
				    }
				    if(jsonobj.bdef75){
						var data = {
						"index" : 2,
						"src" : getImgUrl(jsonobj.bdef75)
					    };
					    angularScope.sxjazwz1.push(data);
					    angularScope.bcameranum = angularScope.bcameranum+1;
				    }
				    if(jsonobj.bdef74){
						var data = {
						"index" : 3,
						"src" : getImgUrl(jsonobj.bdef74)
					    };
					    angularScope.sxjazwz1.push(data);
					    angularScope.bcameranum = angularScope.bcameranum+1;
				    }
				    if(jsonobj.bdef73){
						var data = {
						"index" : 4,
						"src" : getImgUrl(jsonobj.bdef73)
					    };
					    angularScope.sxjazwz1.push(data);
					    angularScope.bcameranum = angularScope.bcameranum+1;
				    }
				    
				 	angularScope.$apply();
					changeLoadingTitle();
					
				}, function(err) {
					console.log(err);
				});
			}
	var pageid = "xianchangkancha";
	var app = angular.module('myApp', []);
	app.controller('myCtrl', function($scope, $http) {
	    angularScope = $scope;
		angularScope.bcameranum = 1;
		angularScope.formdata = {
			"bodyid":"",
		    "is_temporary":"N",
			"dwbh1" : "",
			"sjjymc1" : "",
			"sjjydz1" : "",
			"dmfzr1" : "",
			"lxfs1" : "",
			"sgdw1" : "",
			"jd1" : "",
			"wd1" : "",
			"sblx1" : "",
			"azfs1" : "",
			"materialspec" : "",
			"sbazwzyj1" : LOCAT_CAMERA,
			"sbazwzjj1" : LOCAT_CAMERA,
			"qzqr1" : LOCAT_CAMERA,
			"sbqdwz1" : "0",
			"sxjqdwz1" : "0",
			"wwjrwz1" : "0",
			"azks1" : "0",
			"def1" : false,
			"def2" : false,
			"def3" : false,
			//"qz":LOCAT_CAMERA,
			"qtyj1":"",
			"def79":false,
			"def72":false
			
		}
		angularScope.sxjazwz1= [{
				"index" : 1,
				"src" : LOCAT_CAMERA
			}]
		angularScope.selectlist = {
			"sbqdwz1list" : [],
			"sxjqdwz1list" : [],
			"wwjrwz1list" : [],
		}
		angularScope.close = function(){
			summer.closeWin();
		 
		}
		angularScope.submit = function(){
		if(angularScope.formdata.is_temporary == "N"){
		     UM.confirm({
				title: '友情提示:',
				text: '确认要提交到服务器吗？',
				btnText: ["取消", "提交"],
				overlay: true,
				ok: function() {
					page_submit();
				},
				cancle: function() {}
			});
			}else{
				page_submit();
			}
		}
		function page_submit (){
		    var jd1 = $("#jd1").val();
			 var wd1 =  $("#wd1").val();
			 
			 //if(!jd||!jd1){
			 //  toasts("经纬度获取失败");
			 //}
			 if(!imgs['sbazwzyj1']){
			     toasts("请选择设备安装位置(远景)");
			     return;
			 }
			  if(angularScope.formdata.sbqdwz1 == '0'||angularScope.formdata.sbqdwz1==0){
			     toasts("请选择设备取电位置");
			      return;
			 }
			 for (i = 1 ;i<=angularScope.bcameranum;i++){
				 if (!imgs['sxjazwz1_'+i]){
				     toasts("请选择摄像机安装位置:"+i);
			       	  return;
				 }
			 
			 }
		     if(angularScope.formdata.sxjqdwz1 == '0'||angularScope.formdata.sxjqdwz1==0){
			     toasts("请选择摄像机取电位置");
			      return;
			 }
			 if(angularScope.formdata.wwjrwz1 == '0'||angularScope.formdata.wwjrwz1==0){
			     toasts("请选择外网接入位置");
			      return;
			 }
			 var azks1data = $("#azks1").val();
			 if(!azks1data){
			  	toasts("请选择安装开始时间");
			  	 return;
			 }
		     var azjs1data = $("#azjs1").val();
			 if(!azjs1data){
			  	toasts("请选择安装结束时间");
			  	 return;
			 }
			  var azsc1data = $("#azsc1").val();
			  if(!azsc1data){
			  	toasts("安装时常无法算出：请检查结束时间是否小于开始时间");
			  	 return;
			 }
			 
			// if(!imgs['qz']){
			//     toasts("请选择安装派工单中对应店面负责人签字");
			//      return;
			// }
	    var json = {
	       "bodyid":angularScope.formdata.bodyid,
		   "is_temporary":"Y",
           "bdef90":imgs["sbazwzyj1"] == null ? "" : imgs["sbazwzyj1"],
           "bdef89":imgs["sbazwzjj1"] == null ? "" : imgs["sbazwzjj1"],
           "bdef88":angularScope.formdata.sbqdwz1,
		   "bdef87":angularScope.formdata.sxjqdwz1,
		   "bdef86":angularScope.formdata.wwjrwz1,
		   "bdef85":azks1data+"~"+azsc1data,
		   "bdef84":azsc1data,
		   "bdef83":angularScope.formdata.def1,
		   "bdef82":angularScope.formdata.def2,
		   "bdef81":angularScope.formdata.def3,
		   "bdef80":angularScope.formdata.qtyj1,
		   "bdef79":angularScope.formdata.def79,
		   "bdef72":angularScope.formdata.def72,
		   "bdef78":jd1,
		   "bdef77":wd1,
		   "bdef76":imgs["sxjazwz1_1"] == null ? "" : imgs["sxjazwz1_1"],
		   "bdef75":imgs["sxjazwz1_2"] == null ? "" : imgs["sxjazwz1_2"],
		   "bdef74":imgs["sxjazwz1_3"] == null ? "" : imgs["sxjazwz1_3"],
		   "bdef73":imgs["sxjazwz1_4"] == null ? "" : imgs["sxjazwz1_4"],
	    };	
	   
	    alert("开始上传："+adressHead.IAzpgDwkcImpl2);
	    
		doPost(adressHead.IAzpgDwkcImpl2, "AzpgDwkcTbhx", {
			dataParm: json
		}, function(jsons) {
		      alert(JSON.stringify(jsons));
			if(jsons.result == 1) {
				
			} else {
				alerts("提示：" + jsons.msg);
			}
		}); 
		}
		angularScope.opendraw = function() {
			$("#changepage2").click();
		}
		angularScope.savepic = function() {
			var myCanvas = document.getElementById("canvas");
            var image = myCanvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); 
            angularScope.formdata.qzqr1=image; 
            $("#back").click();
		}
		angularScope.cancelpic = function() {
		var c=document.getElementById("canvas");
			var ctx=c.getContext("2d");
			ctx.clearRect(0,0,c.width,c.height);
            angularScope.formdata.qzqr1=LOCAT_CAMERA; 
            $("#back").click();
		}
		angularScope.reducepic = function() {
		    if(angularScope.bcameranum<4){
				angularScope.bcameranum = angularScope.bcameranum + 1;
				var data = {
					"index" : angularScope.bcameranum,
					"src" : LOCAT_CAMERA
				};
				angularScope.sxjazwz1.push(data);
			}
		}
		angularScope.addpic = function() {

			if (angularScope.bcameranum > 1) {
				angularScope.sxjazwz1.splice(angularScope.bcameranum - 1, 1);
				angularScope.bcameranum = angularScope.bcameranum - 1
                
			} else {
				angularScope.bcameranum = 1
			}
		}
		/**laydate.render({
			elem : '#azks1',
			type : 'datetime', //指定元素
			done : function(value) {
				var azks1 = value;
				var azjs1 = $("#azjs1").val();
				var azsc1 = DateDiff(azks1, azjs1);
				$("#azsc1").val(azsc1);
			}
		});
		laydate.render({
			elem : '#azjs1',
			type : 'datetime', //指定元素
			done : function(value) {
				var azks1 = $("#azks1").val();
				var azjs1 = value;
				var azsc1 = DateDiff(azks1, azjs1)
				$("#azsc1").val(azsc1);
			}
		});*/

	});
	function DateDiff(d1, d2) {
        if(d1==null || d1==undefined || d1==''){
        return "";
        
        }
        if(d2==null || d2==undefined || d2==''){
        
        return "";
        }
		var day = 24 * 60 * 60 * 1000;
		try {
		 var arr1 = d1.split(/[- : \/]/),
             date1 = new Date(arr1[0], arr1[1]-1, arr1[2], arr1[3], arr1[4]);

			//var date1 = new Date(d1);
			//开始时间
		var arr2 = d2.split(/[- : \/]/),
             date2 = new Date(arr2[0], arr2[1]-1, arr2[2], arr2[3], arr2[4]);	
			//var date2 = new Date(d2);
			//结束时间
			var date3 = date2.getTime() - date1.getTime();
			//时间差秒
			if (isNaN(date3) || date3 <= 0) {
				return "";
			}
			//计算出相差天数
			var days = Math.floor(date3 / (24 * 3600 * 1000));
			//计算出小时数
			var leave1 = date3 % (24 * 3600 * 1000);
			//计算天数后剩余的毫秒数
			var hours = Math.floor(leave1 / (3600 * 1000));
			//计算相差分钟数
			var leave2 = leave1 % (3600 * 1000);
			//计算小时数后剩余的毫秒数
			var minutes = Math.floor(leave2 / (60 * 1000));
			//计算相差秒数
			var leave3 = leave2 % (60 * 1000);
			//计算分钟数后剩余的毫秒数
			var seconds = Math.round(leave3 / 1000);
			return days + "天" + hours + "时" + minutes + "分" + seconds + "秒";
		} catch(e) {
			return "";
		}
	}

	function zidongdingwei() {
		window.navigator.geolocation.getCurrentPosition(onSuccess, onError);
		/* var geolocation = new BMap.Geolocation();
		 geolocation.getCurrentPosition(function (r) {
		 if (this.getStatus() == BMAP_STATUS_SUCCESS) {
		 currentLat = r.point.lat;
		 currentLon = r.point.lng;
		 if(currentLat && currentLon){
		 $("#jd1").val(currentLon);
		 $("#wd1").val(currentLat);
		 } else{
		 alerts("定位失败，请打开GPS并允许权限后再试,请勿继续填写信息,本单据将无法正常提交...",function(){
		 summer.closeWin();
		 });
		 }
		 }else{
		 alerts("定位失败，请打开GPS并允许权限后再试,请勿继续填写信息,本单据将无法正常提交...",function(){
		 summer.closeWin();
		 });

		 }
		 });**/
	}

	function ding(data) {
		if(data.status == 0) {
			var gpsPoint = data.result;
				if(gpsPoint&&gpsPoint.location){
				   $("#jd1").val(gpsPoint.location.lng);
				   $("#wd1").val(gpsPoint.location.lat);
				}
			}else{
			 alerts("定位失败，请打开GPS并允许权限后再试,请勿继续填写信息,本单据将无法正常提交...",function(){
				summer.closeWin();
			});
			
			}
	}

	function onSuccess(position) {
		getgaode([position.coords.longitude, position.coords.latitude]);
		//获取高德地区编码
		$.getScript("http://api.map.baidu.com/geocoder/v2/?callback=ding&location=" + position.coords.latitude.toString() + "," + position.coords.longitude.toString() + "&output=json&ak=U7h9KjLwXhNqhglbjqlzrbNg");
	};

	function onError(error) {
	alerts("定位失败，请打开GPS并允许权限后再试,请勿继续填写信息,本单据将无法正常提交...",function(){
				summer.closeWin();
			});
	}

</script>
<script>
     $(function(){  
            var currYear = (new Date()).getFullYear();    
            var opt={};  
            opt.date = {preset : 'date'};  
            opt.datetime = {preset : 'datetime'};  
            opt.time = {preset : 'time'};  
            opt.default1 = {  
                theme: 'android-ics light', //皮肤样式  
                display: 'modal', //显示方式   
                mode: 'scroller', //日期选择模式  
                dateFormat: 'yyyy/mm/dd',  
                lang: 'zh',  
                showNow: true,  
                nowText: "今天",  
                startYear: currYear - 10, //开始年份  
                endYear: currYear + 80 ,//结束年份  
                onSelect:function(valueText,inst){
		         var azks1 = valueText;
				 var azjs1 = $("#azjs1").val();
				
				 	var azsc1 = DateDiff(azks1, azjs1);
				  	$("#azsc1").val(azsc1);
				
		         
		        }
		        
            };  
            opt.default2 = {  
                theme: 'android-ics light', //皮肤样式  
                display: 'modal', //显示方式   
                mode: 'scroller', //日期选择模式  
                dateFormat: 'yyyy/mm/dd',  
                lang: 'zh',  
                showNow: true,  
                nowText: "今天",  
                startYear: currYear - 10, //开始年份  
                endYear: currYear + 80 ,//结束年份  
                onSelect:function(valueText,inst){
		        
				if(this.id && this.id == "azjs1"){
					var azks1 = $("#azks1").val();
					var azjs1 = valueText;
					var azsc1 = DateDiff(azks1, azjs1);
					$("#azsc1").val(azsc1);
		        	}
		         }
            };  
            var optDateTime1 = $.extend(opt['datetime'], opt['default1']);  
            var optDateTime2 = $.extend(opt['datetime'], opt['default2']);  
            $("#azks1").mobiscroll(optDateTime1);
            $("#azjs1").mobiscroll(optDateTime2);
  
         });  
	//window.onload = function() {
	//zidongdingwei();
	//}

</script>
<script src="../../js/Myjs/Common.js"></script>
